import {FC,ReactNode} from 'react'
import { RouteComponentProps,NavLink,Route } from 'react-router-dom';
type Iprops = {
    to:string
    children:ReactNode
}
const CustomLink:FC<Iprops> = (props) => {
    // console.log(props);
    let {to,children} = props;
    return(
        <Route
            path={to}
            children={(props:any)=>{
                let {match} = props;
                // console.log(match);
                return(
                    <NavLink activeClassName='jihuo' to={to}>
                        {match ? "❤"+children : children}
                    </NavLink>
                )
            }}
        />
            
        
    )
}
export default CustomLink